/*
 * © 2010 Autodata Solutions Company. All Rights Reserved
 * This source code is the confidential and proprietary information of Autodata Solutions Company.
 * The user shall not, in whole or in part, copy, publish, disclose or make any use of this source code
 * without the prior written consent of Autodata Solutions Company.
 */
Ext.ns('net.autodata.compare');
(function () {
	
	var DQ = Ext.DomQuery;
	
	/**
	 * This view class is used to control how the CompareVehiclesPanel is rendered
	 * @class CompareVehiclesPhotoView
	 * @extends net.autodata.compare.CompareVehiclesView
	 * @namespace net.autodata.compare
	 */
	var View = Ext.extend(net.autodata.compare.CompareVehiclesView, {
		
		/**
		 * An optional extra CSS class that will be added to this component's Element (defaults to ''). 
		 * This can be useful for adding customized styles to the component 
		 * or any of its children using standard CSS rules.
		 * @property cls
		 * @type String
		 */
		cls: 'photo-view',
		
		/**
		 * @property baseVehicleWidth
		 * @type int
		 */
		baseVehicleWidth: 197,
				
		/**
		 * @property competitorWidth
		 * @type int
		 */
		competitorWidth: 197,
		
		/**
		 * @property lastCompetitorWidth
		 * @type int
		 */
		lastCompetitorWidth: 197,
		
		/**
		 * @property competitorVehicleViewCfg
		 * @type Object
		 */
		competitorVehicleViewCfg: {
			imageCfg: {
				imageWidth: 194,
				imageHeight: 95
			}
		},
		
		emptyCompetitorViewCfg: {
			comboWidth: 180
		},
		
		/**
		 * @method createBaseVehiclePanel
		 * @param {String} renderTo
		 * @param {Ext.data.Record} vehicle
		 * @param {Object} [viewCfg] Optional
		 */
		createBaseVehiclePanel: function (renderTo, vehicle, viewCfg)
		{
			return new net.autodata.compare.VehiclePanel({
				view: new net.autodata.compare.BaseVehiclePhotoView(viewCfg),
				renderTo: renderTo,
				vehicle: vehicle.data,
				listeners: {
					'change': this._compareAnother,
					scope: this
				}
			});
		}
		
	});
	
	net.autodata.compare.CompareVehiclesPhotoView = View;
	
})();